package com.wwh.spring.component;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author Albert
 * @date 2024/8/27-18:31
 * @describe
 */
@Component
public class UserService {
    @Autowired
    private UserDAO userDAO;

    public void m1(){
        userDAO.hi();
    }

    @PostConstruct//指定该方法为初始化方法
    public void init(){
        System.out.println("UserService -- init");
    }
}
